<script setup lang="ts">
import { RouterView } from 'vue-router'
</script>

<template>
  <Suspense>
    <!-- 具有深层异步依赖的组件 -->
    <RouterView class="box" />

    <!-- 在 #fallback 插槽中显示 “正在加载中” -->
    <template #fallback> Loading... </template>
  </Suspense>

  <RouterView class="footer" name="footer" />
</template>

<style lang="scss">
html,
body,
#app {
  height: 100%;
}

#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  width: 100%;
  max-width: 768px;
  min-width: 350px; /*no*/
  margin: 0 auto;
  color: #2c3e50;
  display: flex;
  flex-direction: column;
  .box {
    flex: 1;
    background: #f6f6f6;
    overflow: auto;
  }
  .footer {
    height: 100px;
  }

  .v-enter-active {
    animation: move 1s;
  }
  @keyframes move {
    from {
      transform: translateX(-100%);
    }
    to {
      transform: translateX(0%);
    }
  }
}
</style>
